<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<!--    <meta charset="utf-8">-->
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <title>添加用户--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="resources/css/public.css" media="all"/>
</head>
<body class="childrenBody">
<form class="layui-form" style="width:80%;" lay-filter="dataFrm" id="dataFrm">
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">提现金额:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input amount" name="amount" lay-verify="required" >
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="tx">提现</button>
            <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary" onclick="parent.close();">取消</button>
        </div>
    </div>
    </div>
</form>
</body>
<script type="text/javascript" src="resources/layui/layui.js"></script>
<script th:inline="none">
    var html = "";
    layui.use(['form', 'layer', 'table', 'laytpl', 'laydate', 'upload'], function () {
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laytpl = layui.laytpl,
            table = layui.table,
            laydate = layui.laydate,
            upload = layui.upload;

        //提现
        form.on("submit(tx)", function (data) {
            var index = layer.msg('数据提交中，请稍候', {icon: 16, time: false, shade: 0.8});
            //实际使用时的提交数据
            var params = $("#dataFrm").serialize();

            $.post("/commissiontomerchantUser.do", params, function (res) {

                if (res.code == 200) {
                    setTimeout(function () {
                        top.layer.close(index);
                        top.layer.msg(res.msg);
                        parent.location.reload();
                    }, 2000)
                }else {
                    top.layer.msg(res.msg);
                    location.reload();
                }
            }, "json");
            return false;
        });

    })
</script>
</body>
</html>